home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- # Shell script to create dependency lines for inclusion in a Makefile.
- # This is done by pulling each file through the C preprocessor,
- # filtering all '# <file> 1' lines out and doing some substitutions
- # on them. Since the format of these lines may be different on your
- # system, you may have to modify the sed command below.
-
- ARGS=
- while :
- do
- case $1 in
- -*) ARGS="$ARGS $1"; shift;;
- *) break;;
- esac
- done
-
- for file
- do
- obj=`basename $file .c`.o
- cc $ARGS -E $file |
- sed -n '/^# 1 "\(.*\)".*$/s//'$obj': \1/p'
- done
-